import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import UserCenter from '@/components/user/UserCenter'
import Login from '@/components/login/Login'
import Register from '@/components/register/Register'
import ProductDeatil from '@/components/advance/ProductDeatil'
import Advance from '@/components/advance/detail/Advance'
import Payment from '@/components/advance/detail/Payment'
import PaymentResult from '@/components/advance/detail/PaymentResult'
import AdvanceVerify from '@/components/advance/detail/AdvanceVerify'
import AdvanceTicket from '@/components/user/ticket/AdvanceTicket'
import Wallet from '@/components/user/wallet/Wallet'
import Recharge from '@/components/user/wallet/Recharge'
import RechargeConfirm from '@/components/user/wallet/RechargeConfirm'
import Withdraw from '@/components/user/wallet/Withdraw'
import ChangeCard from '@/components/user/wallet/ChangeCard'
import Ticket from '@/components/user/ticket/Ticket'
import Member from '@/components/user/member/Member'
import Set from '@/components/user/set/Set'
import Agent from '@/components/user/agent/Agent'
import RealName from '@/components/user/realName/RealName'
import NotVerify from '@/components/user/realName/NotVerify'
import Security from '@/components/user/security/Security'
import UpdatePassword from '@/components/user/security/UpdatePassword'
import UpdatePaymentCode from '@/components/user/security/UpdatePaymentCode'
import Parameter from '@/components/user/parameter/Parameter'
import Assist from '@/components/user/assist/Assist'
import Order from '@/components/user/order/Order'
import OrderDeatil from '@/components/user/order/OrderDetail'

import routerHandler from "./router";

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      meta: {
        title: '首页'
      }
    },
    {
      path: '/user',
      name: 'UserCenter',
      component: UserCenter,
      meta: {
        title: '个人中心'
      }
    },
    {
      path: '/login',
      name: 'login',
      component: Login,
      meta: {
        title: '登录'
      }
    },
    {
      path: '/register',
      name: 'register',
      component: Register,
      meta: {
        title: '注册'
      }
    },
    {
      path: '/productDeatil/:id',
      name: 'productDeatil',
      component: ProductDeatil,
      meta: {
        title: '预付款'
      }
    },
    {
      path: '/advance',
      name: 'advance',
      component: Advance,
      meta: {
        title: '预付款'
      }
    },
    {
      path: '/payment',
      name: 'payment',
      component: Payment,
      meta: {
        title: '订单支付'
      }
    },
    {
      path: '/paymentResult',
      name: 'payment-result',
      component: PaymentResult,
      meta: {
        title: '支付结果'
      }
    },
    {
      path: '/advanceVerify',
      name: 'advance-verify',
      component: AdvanceVerify,
      meta: {
        title: '预付款'
      }
    },
    {
      path: '/advanceTicket',
      name: 'advance-ticket',
      component: AdvanceTicket,
      meta: {
        title: '预付款券'
      }
    },
    {
      path: '/wallet',
      name: 'wallet',
      component: Wallet,
      meta: {
        title: '钱包'
      }
    },
    {
      path: '/recharge',
      name: 'recharge',
      component: Recharge,
      meta: {
        title: '充值'
      }
    },
    {
      path: '/RechargeConfirm',
      name: 'recharge-confirm',
      component: RechargeConfirm,
      meta: {
        title: '充值确认'
      }
    },
    {
      path: '/withdraw',
      name: 'withdraw',
      component: Withdraw,
      meta: {
        title: '提现'
      }
    },
    {
      path: '/changeCard',
      name: 'change-card',
      component: ChangeCard,
      meta: {
        title: '绑定银行卡'
      }
    },
    {
      path: '/ticket',
      name: 'ticket',
      component: Ticket,
      meta: {
        title: '优惠券'
      }
    },
    {
      path: '/member',
      name: 'member',
      component: Member,
      meta: {
        title: '会员中心'
      }
    },
    {
      path: '/set',
      name: 'set',
      component: Set,
      meta: {
        title: '设置'
      }
    },
    {
      path: '/agent',
      name: 'agent',
      component: Agent,
      meta: {
        title: '经纪人'
      }
    },
    {
      path: '/realName',
      name: 'real-name',
      component: RealName,
      meta: {
        title: '实名认证'
      }
    },
    {
      path: '/notVerify',
      name: 'not-verify',
      component: NotVerify,
      meta: {
        title: '未实名认证'
      }
    },
    {
      path: '/security',
      name: 'security',
      component: Security,
      meta: {
        title: '未实名认证'
      }
    },
    {
      path: '/updatePassword',
      name: 'update-password',
      component: UpdatePassword,
      meta: {
        title: '修改登录密码'
      }
    },
    {
      path: '/updatePaymentCode',
      name: 'update-payment-code',
      component: UpdatePaymentCode,
      meta: {
        title: '修改支付密码'
      }
    },
    {
      path: '/parameter',
      name: 'parameter',
      component: Parameter,
      meta: {
        title: '参数设置'
      }
    },
    {
      path: '/assist',
      name: 'assist',
      component: Assist,
      meta: {
        title: '预付款订单'
      }
    },
    {
      path: '/order',
      name: 'order',
      component: Order,
      meta: {
        title: '我的订单'
      }
    },
    {
      path: '/orderDetail',
      name: 'order-detail',
      component: OrderDeatil,
      meta: {
        title: '订单详情'
      }
    },

  ]
})

router.beforeEach(routerHandler)
export default router
